#include <stdio.h>
#include <math.h>
int IsPrime(unsigned int m)
{
    int i;
    if(0==m)
    {
        printf("Wrong input!It's meaningless to judge whether 0 is a prime!\n");
        exit(0);
    }
    if(1==m)
    {
        printf("Wrong input!It's meaningless to judge whether 0 is a prime!\n");
        exit(0);
    }
    for(i=2;i<=sqrt(m);i++)
    {
        if(0==m%i)
        {
            return 0;
        }
    }
    return 1;
}
void main()
{
    unsigned int m;
    printf("please input a number:");
    scanf("%u",&m);
    if(!IsPrime(m))
    {
        printf("%d is not a prime number\n",m);
        printf("It has divisor:");
        int i;
        for(i=2;i<m;i++)
        {
            if(0==m%i)
            {
                printf("%d\n",i);
            }
        }
    }
    else
        printf("No divisor!It is a prime number\n");
}
